package enum_demo;

import java.util.Arrays;
import java.util.List;

/**
 * Description: 内部枚举类
 *
 * @author code-worker
 * @date 2021/10/10 8:49
 */
public class InnerEnumDemo {
    private final String name;
    private final BelongHome belongHome;
    public enum  BelongHome{
        //氏族
        LI, ZHANG, WANG
    }

    public InnerEnumDemo(String name, BelongHome belongHome) {
        this.name = name;
        this.belongHome = belongHome;
    }

    public String getName() {
        return name;
    }

    public BelongHome getBelongHome() {
        return belongHome;
    }

    @Override
    public String toString() {
        return "InnerEnumDemo{" +
                "name='" + name + '\'' +
                ", belongHome=" + belongHome +
                '}';
    }

    public static List<InnerEnumDemo> initData(){
        return Arrays.asList(
                new InnerEnumDemo("张三", BelongHome.ZHANG),
                new InnerEnumDemo("李四", BelongHome.LI)
        );
    }

    public static void main(String[] args) {
        System.out.println(InnerEnumDemo.initData());
    }
}
